{% assign productCode = include.productCode -%}
{"documents":[
{%- assign searchedpages = site.pages | where: "searchable", true | where: "lang", page.lang %}
{%- for page in searchedpages %}
{%- if page.name == 'CR.md' or page.name == 'CR_RU.md' or page.name == 'CONFIGURATION.md' or page.name == 'CONFIGURATION_RU.md' or page.name == 'CLUSTER_CONFIGURATION.md' or page.name == 'CLUSTER_CONFIGURATION_RU.md' %}{% continue %}{% endif %}
{"title": "{{ page.title | escape }}",
"url": "{{ page.url | remove_first: "/" | regex_replace: '^(ru/|en/)', '' }}",
"keywords": {{ page.search | jsonify }},
"content": {{ page.content | normalizeSearchContent | jsonify -}}
}
{%- unless forloop.last %},{% endunless %}
{%- endfor -%}
],
"parameters":[
{%- for item in site.data.search.searchItems[page.lang] %}
{%- assign page_canonical_url = item.url | relative_url %}
{%- assign keywords = "" %}
{%- if item.search.size > 0 %}
  {%- if keywords.size > 0 %}
    {%- assign keywords = item.search | append: ", " | append: keywords %}
  {%- else %}
    {%- assign keywords = item.search %}
  {%- endif %}
{%- endif %}
{
"name": "{{ item.name }}",
"module": "{{ item.module | default: "global" }}",
"moduletype": "embedded",
"url": "{{ page_canonical_url }}",
"resName": "{{ item.resourceName | escape }}",
{%- if item.isResource %}
"isResource": "true",
{%- endif %}
{%- if item.deprecated %}
"deprecated": "true",
{%- endif %}
{%- if keywords.size > 0 %}
"keywords": {{ keywords | jsonify }},
{%- endif %}
"path": "{{ item.pathString | escape }}",
"content": {{ item.content | default: '' | normalizeSearchContent | jsonify -}}
}
{%- unless forloop.last %},{% endunless %}
{%- endfor -%}
]}
